package service;

public class StatisticsEvent extends Event {
	
	protected double value;
	
	public StatisticsEvent(String type, double value) {
		super(type);
		this.value=value;
	}
	
	public double getValue() {
		return this.value;
	}
	
	
	public String toString() {
		String string = this.type+": "+dateFormat.format(this.timestamp);
		if(this.type.equals("USER_SESSIONTIME_MIN")) string += " minimum session time is "+this.value/1000+" seconds";
		if(this.type.equals("USER_SESSIONTIME_MAX")) string += " maximum session time is "+this.value/1000+" seconds";
		if(this.type.equals("USER_SESSIONTIME_AVG")) string += " average session time is "+this.value/1000+" seconds";
		if(this.type.equals("BID_PRICE_MAX")) string += " maximum bid price seen so far is "+this.value;
		if(this.type.equals("BID_COUNT_PER_MINUTE")) string += " current bids per minute is "+this.value;
		if(this.type.equals("AUCTION_TIME_AVG")) string += " average auction time is "+this.value/1000+" seconds";
		if(this.type.equals("AUCTION_SUCCESS_RATIO")) string += " current auction success ratio is "+this.value;
		
		
		return string;
	}

}
